package ThreadThree;

public class SaveThread extends Thread{
	Account a;
	double money;
	public SaveThread(Account a,double money) {
		this.a=a;
		this.money=money;
	}
	
	public void run() {
		synchronized (a) {
			double pre=a.getBalance();
			a.saveMoney(money);
			System.out.println("Save: "+"prebalance is:"+pre+"current balance is:"+a.getBalance());
		}
		
	}
}
